import unittest

# 重写unittest.TestCase（可能需要测试很多的手机，那么端口号不是唯一的，如何维护现有的端口号）

class Parmer(unittest.TestCase):
    def __init__(self, methodName='runTest', parme=None):
        super(Parmer, self).__init__(methodName)
        self.parme = parme

    @classmethod
    def parametrize(self,testcase_klass, parame):
        testloader = unittest.TestLoader()
        testnames = testloader.getTestCaseNames(testcase_klass)
        suite = unittest.TestSuite()
        for name in testnames:
            suite.addTest(testcase_klass(methodName=name, parme=parame))
        return suite